Optimal. Leaf size=349 \[ -\frac {\left (a^2-b^2\right )^3 (A b-a B) (a+b \sin (c+d x))^3}{3 b^8 d}+\frac {\left (a^2-b^2\right )^2 \left (6 a A b-7 a^2 B+b^2 B\right ) (a+b \sin (c+d x))^4}{4 b^8 d}-\frac {3 \left (a^2-b^2\right ) \left (5 a^2 A b-A b^3-7 a^3 B+3 a b^2 B\right ) (a+b \sin (c+d x))^5}{5 b^8 d}+\frac {\left (20 a^3 A b-12 a A b^3-35 a^4 B+30 a^2 b^2 B-3 b^4 B\right ) (a+b \sin (c+d x))^6}{6 b^8 d}-\frac {\left (15 a^2 A b-3 A b^3-35 a^3 B+15 a b^2 B\right ) (a+b \sin (c+d x))^7}{7 b^8 d}+\frac {3 \left (2 a A b-7 a^2 B+b^2 B\right ) (a+b \sin (c+d x))^8}{8 b^8 d}-\frac {(A b-7 a B) (a+b \sin (c+d x))^9}{9 b^8 d}-\frac {B (a+b \sin (c+d x))^{10}}{10 b^8 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.28, antiderivative size = 349, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.065, Rules used = {2916, 786}
\begin {gather*} \frac {3 \left (-7 a^2 B+2 a A b+b^2 B\right ) (a+b \sin (c+d x))^8}{8 b^8 d}+\frac {\left (a^2-b^2\right )^2 \left (-7 a^2 B+6 a A b+b^2 B\right ) (a+b \sin (c+d x))^4}{4 b^8 d}-\frac {\left (a^2-b^2\right )^3 (A b-a B) (a+b \sin (c+d x))^3}{3 b^8 d}-\frac {\left (-35 a^3 B+15 a^2 A b+15 a b^2 B-3 A b^3\right ) (a+b \sin (c+d x))^7}{7 b^8 d}-\frac {3 \left (a^2-b^2\right ) \left (-7 a^3 B+5 a^2 A b+3 a b^2 B-A b^3\right ) (a+b \sin (c+d x))^5}{5 b^8 d}+\frac {\left (-35 a^4 B+20 a^3 A b+30 a^2 b^2 B-12 a A b^3-3 b^4 B\right ) (a+b \sin (c+d x))^6}{6 b^8 d}-\frac {(A b-7 a B) (a+b \sin (c+d x))^9}{9 b^8 d}-\frac {B (a+b \sin (c+d x))^{10}}{10 b^8 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 786
Rule 2916
Rubi steps
\begin {align*} \int \cos ^7(c+d x) (a+b \sin (c+d x))^2 (A+B \sin (c+d x)) \, dx &=\frac {\text {Subst}\left (\int (a+x)^2 \left (A+\frac {B x}{b}\right ) \left (b^2-x^2\right )^3 \, dx,x,b \sin (c+d x)\right )}{b^7 d}\\ &=\frac {\text {Subst}\left (\int \left (\frac {\left (-a^2+b^2\right )^3 (A b-a B) (a+x)^2}{b}+\frac {\left (-a^2+b^2\right )^2 \left (6 a A b-7 a^2 B+b^2 B\right ) (a+x)^3}{b}-\frac {3 \left (-a^2+b^2\right ) \left (-5 a^2 A b+A b^3+7 a^3 B-3 a b^2 B\right ) (a+x)^4}{b}+\frac {\left (20 a^3 A b-12 a A b^3-35 a^4 B+30 a^2 b^2 B-3 b^4 B\right ) (a+x)^5}{b}+\frac {\left (-15 a^2 A b+3 A b^3+35 a^3 B-15 a b^2 B\right ) (a+x)^6}{b}-\frac {3 \left (-2 a A b+7 a^2 B-b^2 B\right ) (a+x)^7}{b}+\frac {(-A b+7 a B) (a+x)^8}{b}-\frac {B (a+x)^9}{b}\right ) \, dx,x,b \sin (c+d x)\right )}{b^7 d}\\ &=-\frac {\left (a^2-b^2\right )^3 (A b-a B) (a+b \sin (c+d x))^3}{3 b^8 d}+\frac {\left (a^2-b^2\right )^2 \left (6 a A b-7 a^2 B+b^2 B\right ) (a+b \sin (c+d x))^4}{4 b^8 d}-\frac {3 \left (a^2-b^2\right ) \left (5 a^2 A b-A b^3-7 a^3 B+3 a b^2 B\right ) (a+b \sin (c+d x))^5}{5 b^8 d}+\frac {\left (20 a^3 A b-12 a A b^3-35 a^4 B+30 a^2 b^2 B-3 b^4 B\right ) (a+b \sin (c+d x))^6}{6 b^8 d}-\frac {\left (15 a^2 A b-3 A b^3-35 a^3 B+15 a b^2 B\right ) (a+b \sin (c+d x))^7}{7 b^8 d}+\frac {3 \left (2 a A b-7 a^2 B+b^2 B\right ) (a+b \sin (c+d x))^8}{8 b^8 d}-\frac {(A b-7 a B) (a+b \sin (c+d x))^9}{9 b^8 d}-\frac {B (a+b \sin (c+d x))^{10}}{10 b^8 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.00, size = 295, normalized size = 0.85 \begin {gather*} \frac {-3 a^4 \left (a^6-9 a^4 b^2+42 a^2 b^4-210 b^6\right ) B+2520 a^2 A b^8 \sin (c+d x)+1260 a b^8 (2 A b+a B) \sin ^2(c+d x)+840 b^8 \left (-3 a^2 A+A b^2+2 a b B\right ) \sin ^3(c+d x)+630 b^8 \left (-6 a A b-3 a^2 B+b^2 B\right ) \sin ^4(c+d x)-1512 b^8 \left (-a^2 A+A b^2+2 a b B\right ) \sin ^5(c+d x)+1260 b^8 \left (2 a A b+a^2 B-b^2 B\right ) \sin ^6(c+d x)+360 b^8 \left (-a^2 A+3 A b^2+6 a b B\right ) \sin ^7(c+d x)-315 b^8 \left (2 a A b+a^2 B-3 b^2 B\right ) \sin ^8(c+d x)-280 b^9 (A b+2 a B) \sin ^9(c+d x)-252 b^{10} B \sin ^{10}(c+d x)}{2520 b^8 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.88, size = 229, normalized size = 0.66
method | result | size |
derivativedivides | \(\frac {\frac {a^{2} A \left (\frac {16}{5}+\cos ^{6}\left (d x +c \right )+\frac {6 \left (\cos ^{4}\left (d x +c \right )\right )}{5}+\frac {8 \left (\cos ^{2}\left (d x +c \right )\right )}{5}\right ) \sin \left (d x +c \right )}{7}-\frac {B \,a^{2} \left (\cos ^{8}\left (d x +c \right )\right )}{8}-\frac {A a b \left (\cos ^{8}\left (d x +c \right )\right )}{4}+2 B a b \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{8}\left (d x +c \right )\right )}{9}+\frac {\left (\frac {16}{5}+\cos ^{6}\left (d x +c \right )+\frac {6 \left (\cos ^{4}\left (d x +c \right )\right )}{5}+\frac {8 \left (\cos ^{2}\left (d x +c \right )\right )}{5}\right ) \sin \left (d x +c \right )}{63}\right )+A \,b^{2} \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{8}\left (d x +c \right )\right )}{9}+\frac {\left (\frac {16}{5}+\cos ^{6}\left (d x +c \right )+\frac {6 \left (\cos ^{4}\left (d x +c \right )\right )}{5}+\frac {8 \left (\cos ^{2}\left (d x +c \right )\right )}{5}\right ) \sin \left (d x +c \right )}{63}\right )+B \,b^{2} \left (-\frac {\left (\sin ^{2}\left (d x +c \right )\right ) \left (\cos ^{8}\left (d x +c \right )\right )}{10}-\frac {\left (\cos ^{8}\left (d x +c \right )\right )}{40}\right )}{d}\) | \(229\) |
default | \(\frac {\frac {a^{2} A \left (\frac {16}{5}+\cos ^{6}\left (d x +c \right )+\frac {6 \left (\cos ^{4}\left (d x +c \right )\right )}{5}+\frac {8 \left (\cos ^{2}\left (d x +c \right )\right )}{5}\right ) \sin \left (d x +c \right )}{7}-\frac {B \,a^{2} \left (\cos ^{8}\left (d x +c \right )\right )}{8}-\frac {A a b \left (\cos ^{8}\left (d x +c \right )\right )}{4}+2 B a b \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{8}\left (d x +c \right )\right )}{9}+\frac {\left (\frac {16}{5}+\cos ^{6}\left (d x +c \right )+\frac {6 \left (\cos ^{4}\left (d x +c \right )\right )}{5}+\frac {8 \left (\cos ^{2}\left (d x +c \right )\right )}{5}\right ) \sin \left (d x +c \right )}{63}\right )+A \,b^{2} \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{8}\left (d x +c \right )\right )}{9}+\frac {\left (\frac {16}{5}+\cos ^{6}\left (d x +c \right )+\frac {6 \left (\cos ^{4}\left (d x +c \right )\right )}{5}+\frac {8 \left (\cos ^{2}\left (d x +c \right )\right )}{5}\right ) \sin \left (d x +c \right )}{63}\right )+B \,b^{2} \left (-\frac {\left (\sin ^{2}\left (d x +c \right )\right ) \left (\cos ^{8}\left (d x +c \right )\right )}{10}-\frac {\left (\cos ^{8}\left (d x +c \right )\right )}{40}\right )}{d}\) | \(229\) |
risch | \(\frac {B \,b^{2} \cos \left (10 d x +10 c \right )}{5120 d}-\frac {7 \cos \left (2 d x +2 c \right ) B \,a^{2}}{128 d}-\frac {7 \cos \left (2 d x +2 c \right ) B \,b^{2}}{512 d}-\frac {\cos \left (6 d x +6 c \right ) B \,a^{2}}{128 d}+\frac {\cos \left (6 d x +6 c \right ) B \,b^{2}}{1024 d}+\frac {7 \sin \left (5 d x +5 c \right ) a^{2} A}{320 d}-\frac {\sin \left (5 d x +5 c \right ) A \,b^{2}}{160 d}-\frac {7 \cos \left (4 d x +4 c \right ) B \,a^{2}}{256 d}-\frac {\cos \left (4 d x +4 c \right ) B \,b^{2}}{256 d}-\frac {\cos \left (8 d x +8 c \right ) B \,a^{2}}{1024 d}+\frac {\cos \left (8 d x +8 c \right ) B \,b^{2}}{1024 d}+\frac {\sin \left (7 d x +7 c \right ) a^{2} A}{448 d}-\frac {5 \sin \left (7 d x +7 c \right ) A \,b^{2}}{1792 d}+\frac {7 a^{2} A \sin \left (3 d x +3 c \right )}{64 d}+\frac {35 \sin \left (d x +c \right ) a^{2} A}{64 d}+\frac {7 \sin \left (d x +c \right ) A \,b^{2}}{128 d}-\frac {\sin \left (9 d x +9 c \right ) A \,b^{2}}{2304 d}+\frac {7 \sin \left (d x +c \right ) B a b}{64 d}-\frac {\sin \left (9 d x +9 c \right ) B a b}{1152 d}-\frac {\cos \left (8 d x +8 c \right ) A a b}{512 d}-\frac {5 \sin \left (7 d x +7 c \right ) B a b}{896 d}-\frac {\cos \left (6 d x +6 c \right ) A a b}{64 d}-\frac {\sin \left (5 d x +5 c \right ) B a b}{80 d}-\frac {7 \cos \left (4 d x +4 c \right ) A a b}{128 d}-\frac {7 \cos \left (2 d x +2 c \right ) A a b}{64 d}\) | \(435\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 238, normalized size = 0.68 \begin {gather*} -\frac {252 \, B b^{2} \sin \left (d x + c\right )^{10} + 280 \, {\left (2 \, B a b + A b^{2}\right )} \sin \left (d x + c\right )^{9} + 315 \, {\left (B a^{2} + 2 \, A a b - 3 \, B b^{2}\right )} \sin \left (d x + c\right )^{8} + 360 \, {\left (A a^{2} - 6 \, B a b - 3 \, A b^{2}\right )} \sin \left (d x + c\right )^{7} - 1260 \, {\left (B a^{2} + 2 \, A a b - B b^{2}\right )} \sin \left (d x + c\right )^{6} - 1512 \, {\left (A a^{2} - 2 \, B a b - A b^{2}\right )} \sin \left (d x + c\right )^{5} + 630 \, {\left (3 \, B a^{2} + 6 \, A a b - B b^{2}\right )} \sin \left (d x + c\right )^{4} - 2520 \, A a^{2} \sin \left (d x + c\right ) + 840 \, {\left (3 \, A a^{2} - 2 \, B a b - A b^{2}\right )} \sin \left (d x + c\right )^{3} - 1260 \, {\left (B a^{2} + 2 \, A a b\right )} \sin \left (d x + c\right )^{2}}{2520 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.42, size = 174, normalized size = 0.50 \begin {gather*} \frac {252 \, B b^{2} \cos \left (d x + c\right )^{10} - 315 \, {\left (B a^{2} + 2 \, A a b + B b^{2}\right )} \cos \left (d x + c\right )^{8} - 8 \, {\left (35 \, {\left (2 \, B a b + A b^{2}\right )} \cos \left (d x + c\right )^{8} - 5 \, {\left (9 \, A a^{2} + 2 \, B a b + A b^{2}\right )} \cos \left (d x + c\right )^{6} - 6 \, {\left (9 \, A a^{2} + 2 \, B a b + A b^{2}\right )} \cos \left (d x + c\right )^{4} - 144 \, A a^{2} - 32 \, B a b - 16 \, A b^{2} - 8 \, {\left (9 \, A a^{2} + 2 \, B a b + A b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{2520 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 1.83, size = 389, normalized size = 1.11 \begin {gather*} \begin {cases} \frac {16 A a^{2} \sin ^{7}{\left (c + d x \right )}}{35 d} + \frac {8 A a^{2} \sin ^{5}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{5 d} + \frac {2 A a^{2} \sin ^{3}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{d} + \frac {A a^{2} \sin {\left (c + d x \right )} \cos ^{6}{\left (c + d x \right )}}{d} - \frac {A a b \cos ^{8}{\left (c + d x \right )}}{4 d} + \frac {16 A b^{2} \sin ^{9}{\left (c + d x \right )}}{315 d} + \frac {8 A b^{2} \sin ^{7}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{35 d} + \frac {2 A b^{2} \sin ^{5}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{5 d} + \frac {A b^{2} \sin ^{3}{\left (c + d x \right )} \cos ^{6}{\left (c + d x \right )}}{3 d} - \frac {B a^{2} \cos ^{8}{\left (c + d x \right )}}{8 d} + \frac {32 B a b \sin ^{9}{\left (c + d x \right )}}{315 d} + \frac {16 B a b \sin ^{7}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{35 d} + \frac {4 B a b \sin ^{5}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{5 d} + \frac {2 B a b \sin ^{3}{\left (c + d x \right )} \cos ^{6}{\left (c + d x \right )}}{3 d} - \frac {B b^{2} \sin ^{2}{\left (c + d x \right )} \cos ^{8}{\left (c + d x \right )}}{8 d} - \frac {B b^{2} \cos ^{10}{\left (c + d x \right )}}{40 d} & \text {for}\: d \neq 0 \\x \left (A + B \sin {\left (c \right )}\right ) \left (a + b \sin {\left (c \right )}\right )^{2} \cos ^{7}{\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.61, size = 279, normalized size = 0.80 \begin {gather*} \frac {B b^{2} \cos \left (10 \, d x + 10 \, c\right )}{5120 \, d} + \frac {7 \, A a^{2} \sin \left (3 \, d x + 3 \, c\right )}{64 \, d} - \frac {{\left (B a^{2} + 2 \, A a b - B b^{2}\right )} \cos \left (8 \, d x + 8 \, c\right )}{1024 \, d} - \frac {{\left (8 \, B a^{2} + 16 \, A a b - B b^{2}\right )} \cos \left (6 \, d x + 6 \, c\right )}{1024 \, d} - \frac {{\left (7 \, B a^{2} + 14 \, A a b + B b^{2}\right )} \cos \left (4 \, d x + 4 \, c\right )}{256 \, d} - \frac {7 \, {\left (4 \, B a^{2} + 8 \, A a b + B b^{2}\right )} \cos \left (2 \, d x + 2 \, c\right )}{512 \, d} - \frac {{\left (2 \, B a b + A b^{2}\right )} \sin \left (9 \, d x + 9 \, c\right )}{2304 \, d} + \frac {{\left (4 \, A a^{2} - 10 \, B a b - 5 \, A b^{2}\right )} \sin \left (7 \, d x + 7 \, c\right )}{1792 \, d} + \frac {{\left (7 \, A a^{2} - 4 \, B a b - 2 \, A b^{2}\right )} \sin \left (5 \, d x + 5 \, c\right )}{320 \, d} + \frac {7 \, {\left (10 \, A a^{2} + 2 \, B a b + A b^{2}\right )} \sin \left (d x + c\right )}{128 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.18, size = 236, normalized size = 0.68 \begin {gather*} \frac {{\sin \left (c+d\,x\right )}^2\,\left (\frac {B\,a^2}{2}+A\,b\,a\right )-{\sin \left (c+d\,x\right )}^9\,\left (\frac {A\,b^2}{9}+\frac {2\,B\,a\,b}{9}\right )+{\sin \left (c+d\,x\right )}^3\,\left (-A\,a^2+\frac {2\,B\,a\,b}{3}+\frac {A\,b^2}{3}\right )-{\sin \left (c+d\,x\right )}^5\,\left (-\frac {3\,A\,a^2}{5}+\frac {6\,B\,a\,b}{5}+\frac {3\,A\,b^2}{5}\right )+{\sin \left (c+d\,x\right )}^7\,\left (-\frac {A\,a^2}{7}+\frac {6\,B\,a\,b}{7}+\frac {3\,A\,b^2}{7}\right )+{\sin \left (c+d\,x\right )}^6\,\left (\frac {B\,a^2}{2}+A\,a\,b-\frac {B\,b^2}{2}\right )-{\sin \left (c+d\,x\right )}^4\,\left (\frac {3\,B\,a^2}{4}+\frac {3\,A\,a\,b}{2}-\frac {B\,b^2}{4}\right )-{\sin \left (c+d\,x\right )}^8\,\left (\frac {B\,a^2}{8}+\frac {A\,a\,b}{4}-\frac {3\,B\,b^2}{8}\right )-\frac {B\,b^2\,{\sin \left (c+d\,x\right )}^{10}}{10}+A\,a^2\,\sin \left (c+d\,x\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________